package sg.edu.nus.iss.billing.model.complaint;

import sg.edu.nus.iss.billing.model.BaseModel;

/**
 * @author Yeo Hee Ling, BeeHong, EngKhoon
 *
 */
public class Complaint extends BaseModel{
	private static final long serialVersionUID = 1L;
	private String complaintId;
	private String accountNo;
	private String complaintDescription;
	private String complaintStatus;
	private String agentName;
	private String complaintRemarks;
	private String loggedDate;
	private String closedDate;
	
	public enum ComplaintStatus {
		PENDING, CLOSED
	}
	
	public Complaint(String complaintId, String account, String description, String status, String agent,
			String remarks, String logdate, String closedate) {
		this.complaintId = complaintId;
		this.accountNo = account;
		this.complaintDescription = description;
		this.complaintStatus = status;
		this.agentName = agent;
		this.complaintRemarks = remarks;
		this.loggedDate = logdate;
		this.closedDate = closedate;
	}
	
	public String getAccountNo() {
		return accountNo;
	}
	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}
	public String getComplaintId() {
		return complaintId;
	}
	public void setComplaintId(String complaintId) {
		this.complaintId = complaintId;
	}
	public String getLoggedDate() {
		return loggedDate;
	}
	public void setLoggedDate(String loggedDate) {
		this.loggedDate = loggedDate;
	}
	public String getClosedDate() {
		return closedDate;
	}
	public void setClosedDate(String closedDate) {
		this.closedDate = closedDate;
	}
	public String getComplaintStatus() {
		return complaintStatus;
	}
	public void setComplaintStatus(String complaintStatus ) {
		this.complaintStatus = complaintStatus;
	}
	public String getComplaintDescription() {
		return complaintDescription;
	}
	public void setComplaintDescription(String complaintDescription) {
		this.complaintDescription = complaintDescription;
	}
	public String getComplaintRemarks() {
		return complaintRemarks;
	}
	public void setComplaintRemarks(String complaintRemarks) {
		this.complaintRemarks = complaintRemarks;
	}
	public String getAgentName() {
		return agentName;
	}
	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}
	
	public boolean matches(Object complaintObj) {
		if(!(complaintObj instanceof Complaint))
			return false;
		
		Complaint otherComplaint = (Complaint)complaintObj;
		if(!complaintId.equals(otherComplaint.getComplaintId()))
			return false;
		if(!accountNo.equals(otherComplaint.getAccountNo()))
			return false;
		if(!complaintDescription.equals(otherComplaint.getComplaintDescription()))
			return false;
		if(!complaintStatus.equals(otherComplaint.getComplaintStatus()))
			return false;
		if(!agentName.equals(otherComplaint.getAgentName()))
			return false;
		if(!complaintRemarks.equals(otherComplaint.getComplaintRemarks()))
			return false;
		if(!loggedDate.equals(otherComplaint.getLoggedDate()))
			return false;
		if(!closedDate.equals(otherComplaint.getClosedDate()))
			return false;
		
		return true;
	}
}
